<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <body>
        <ui:composition template="./../../WEB-INF/templates/noFooterTemplate.xhtml">
            <ui:define name="content">
                <h:form id="adminPublicRelationshipsForm">
                    <p:panelGrid columns="2" styleClass="noBorder marginBottom20">
                        <h:outputText value="#{messages.ReferalLink}" />
                        <h:outputText value="#{publicRelationsBeanList.publicRelationLink}" />
                        <h:outputText value="#{messages.ViewOfLink}" />
                        <h:outputText value="#{publicRelationsBeanList.publicRelations.referals}" />
                    </p:panelGrid>
                    <p:dataTable id="publicRelationsDataTable" var="rrpp" value="#{publicRelationsBeanList.entityList}" rowKey="#{rrpp.idPublicRelacionshipsCandidate}" selection="#{publicRelationsBeanList.chosenEntity}" selectionMode="single">  
                        <p:column headerText="#{messages.Name}">  
                            <h:outputText value="#{rrpp.candidate.name}" />  
                        </p:column>  
                        <p:column headerText="#{messages.LastName}">  
                            <h:outputText value="#{rrpp.candidate.lastName}" />  
                        </p:column>
                        <p:column headerText="#{messages.Email}">  
                            <h:outputText value="#{rrpp.candidate.user.email}" />  
                        </p:column>
                        <p:column headerText="#{messages.PayPerCandidate}">  
                            <h:outputText value="#{rrpp.amount}" />  
                        </p:column> 
                        <p:column headerText="#{messages.RegisterDate}">  
                            <h:outputText value="#{rrpp.candidate.user.creationDate}">
                                <f:convertDateTime pattern="d/M/yyyy - hh:mm"></f:convertDateTime>
                            </h:outputText>
                        </p:column> 
                        <p:column headerText="#{messages.LastDate}">  
                            <h:outputText value="#{rrpp.candidate.user.lastDate}">
                                <f:convertDateTime pattern="d/M/yyyy - hh:mm"></f:convertDateTime>
                            </h:outputText>
                        </p:column> 
                        <p:column headerText="#{messages.PayDate}"  >  
                            <h:outputText value="#{rrpp.payDate}" rendered="#{rrpp.payDate!=null}">
                                <f:convertDateTime pattern="d/M/yyyy - hh:mm"></f:convertDateTime>
                            </h:outputText>
                            <h:outputText value="#{messages.NoPaidYet}" rendered="#{rrpp.payDate==null}">
                            </h:outputText>
                        </p:column>  
                        <p:column headerText="#{messages.Valid}">  
                            <h:outputText value="#{messages.Yes}" rendered="#{publicRelationsBeanList.isValidCandidate(rrpp.candidate)}" />  
                            <h:outputText value="#{messages.No}" rendered="#{!publicRelationsBeanList.isValidCandidate(rrpp.candidate)}" />  
                        </p:column>
                    </p:dataTable>  
                </h:form>
            </ui:define>
        </ui:composition>
    </body>
</html>
